<!DOCTYPE html>
<html>
<head>
	<title>Ajax</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-compatible" content="IE-edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
	<style>
		body, input, button, select, h1 {
			font-size: 30px;
			line-height: 1.8;
		}
	</style>
</head>
<body>
	<h1>查询员工</h1>
	<label>员工编号：</label>
	<input type="text" id="keyword">
	<button id="search">查询</button>
	<p id="searchResult"></p>
	<h1>创建员工</h1>
	<label>员工姓名：</label>
	<input type="text" id="staffName"><br>
	<label>员工编号：</label>
	<input type="text" id="staffNumber"><br>
	<label>员工性别：</label>
	<select id="staffSex">
		<option>男</option>
		<option>女</option>
	</select><br>
	<label>员工职位：</label>
	<input type="text" id="staffJob"><br>
	<button id="save">保存</button>
	<p id="createResult"></p>
	<script src="js/ajax.js"></script>
	<script>
		document.getElementById('search').onclick = function() {
			// 发送Ajax查询请求并处理
			var request = new XMLHttpRequest();
			request.open('GET', 'php/server.php?number=' + document.getElementById('keyword').value);
			request.send();
		}
	</script>
</body>
</html>
